package com.doitedu.hdfs.utils;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * @Date 2021/11/30
 * @Created by HANGGE
 * @Description封装功能性的方法
 */
public class MyUtils {
    /**
     * @return  返回HDFS客户端对象
     * @throws URISyntaxException
     */
    public  static FileSystem  getFileSystem() throws Exception {
        return FileSystem.newInstance(new URI("hdfs://linux01:8020") , new Configuration() , "root");
    }

}
